package com.zhongshan.ga.mobile.resource;

import org.restlet.representation.Representation;
import org.restlet.representation.StringRepresentation;
import org.restlet.resource.Get;
import org.restlet.resource.Post;
import org.restlet.resource.ServerResource;

import com.google.gson.JsonObject;
import com.zhongshan.ga.logger.GenerateLog;
import com.zhongshan.ga.mobile.logic.GetTravelMateDetailLogic;

/**
 * 获得结伴游详情手机端接口
 * @author yanqi
 *
 */
public class GetTravelMateDetailResource extends ServerResource{

	@Get
	public Representation getTravelMateDetail(Representation entity) {
		GenerateLog.outDebug("调用了获得结伴游详情的方法");
		entity = postTravelMateDetail(entity);
		return entity;
	}
	
	@Post
	public Representation postTravelMateDetail(Representation entity) {
		GenerateLog.outDebug("调用了获得结伴游详情的方法");
		GetTravelMateDetailLogic getTravelMateDetailLogic = new GetTravelMateDetailLogic();
		JsonObject resultJson = getTravelMateDetailLogic.getTravelMateDetail(entity);
		Representation representation = new StringRepresentation(resultJson.toString());
		return representation;
	}
 }
